package net.dopan.pigframe.demo.service;

import net.dopan.pigframe.core.base.service.BaseService;
import net.dopan.pigframe.demo.model.entity.UserConcernUser;
import net.dopan.pigframe.demo.model.entity.vo.*;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;

import java.util.Date;
import java.util.List;
import java.util.Map;

public interface UserConcernUserService extends BaseService<UserConcernUser> {

    //    @Cacheable(key = "'findUserVoByUserId'+#userId")
    UserVo findUserVoByUserId(String userId);

    @Cacheable(cacheNames = "USERCONCERNUSER", key = "'findUserNoteVoByUserId'+#userId+'offset'+#offset+'limit'+#limit")
    List<UserNoteVo> findUserNoteVoByUserId(String userId, int offset, int limit);

    /**
     * 获取用户收藏的活动
     */
    @Cacheable(cacheNames = "USERCONCERNUSER", key = "'findUserCollectMap'+#userId")
    List<Map<String, String>> findUserCollectMap(String userId);

    /**
     * 添加关注
     */
    @CacheEvict(cacheNames = "CONCERNFANS", allEntries = true)
    void concernUser(String userId, String concernUserId);

    /**
     * 查询是否关注
     */
    Integer isConcern(String userId, String concernUserId);

    /**
     * 查询用户粉丝数量
     */
    Integer fansCount(String userId);

    /**
     * 取消关注
     */
    @CacheEvict(cacheNames = "CONCERNFANS", allEntries = true)
    void cancleConcernUser(String userId, String concernUserId);

    /**
     * 查询关注的人
     */
    @Cacheable(cacheNames = "CONCERNFANS", key = "'getConcernUsers' + #userId")
    Map<String, List> getConcernUsers(String userId);

    /**
     * 查找粉丝
     */
    @Cacheable(cacheNames = "CONCERNFANS", key = "'getUserFans' + #userId")
    Map<String, List> getUserFans(String userId);

    /**
     * 获取用户参加的活动
     */
    @Cacheable(cacheNames = "USERACTIVITYPARTICIPANT", key = "'getUserActivityByUserId' + #userId")
    Map<String, List<Map<String, String>>> getUserActivityByUserId(String userId);

    /**
     * 取消活动
     */
    @CacheEvict(cacheNames = "USERACTIVITYPARTICIPANT", key = "'getUserActivityByUserId' + #userId")
    Integer cancleUserActivity(String userId, String activityId);

    /**
     * 获取用户发起的活动
     */
    @Cacheable(cacheNames = "USERSERVICE", key = "'userActivity_' + #userId")
    Map<String, List<Map<String, String>>> getLaunchActivityAndEnd(String userId);

    /**
     * 删除自己发起的活动
     */
    @CacheEvict(cacheNames = "USERSERVICE", key = "'userActivity_' + #userId")
    Integer delUserActivityByUserId(String userId, String activityId);

    /**
     * 编辑活动
     */
    @CacheEvict(cacheNames = "USERSERVICE", key = "'userActivity_' + #userId")
    UserActivityVo1 editUserActivityVo(String userId, String activityId);

    /**
     * 获取用户感兴趣的活动
     */
    @Cacheable(cacheNames = "USERSERVICE", key = "'getLikeUserActivity' + #userId")
    Map<String, List<Map<String, String>>> getLikeUserActivity(String userId);

    @CacheEvict(cacheNames = "USERSERVICE", key = "'getLikeUserActivity' + #userId")
    Integer delLikeUserActivity(String userId, String activityId);

    /**
     * 保存意见反馈
     */
    Integer saveUserFeedBack(UserFeedbackVo userFeedbackVo);

    /**
     * 修改用户UUID
     */
    @CacheEvict(cacheNames = "USERSERVICE", key = "'UserUUIDFlag' + #userId")
    Integer changUserUUID(String userId, String uuid);

    /**
     * 查询用户是否修改过UUID
     */
    @Cacheable(cacheNames = "USERSERVICE", key = "'UserUUIDFlag' + #userId")
    Integer findUserUUIDFlag(String userId);

    /**
     * 获取活动取消原因
     */
    // @Cacheable(cacheNames = "USERSERVICE",key = "'getCancleReason'")
    List<Map<String, String>> getCancleReason();

    /**
     * 保存用户活动取消原因
     */
    Integer saveUserActivityCancle(UserActivityCancleVo userActivityCancleVo);

    /**
     * 活动日历
     */
    Map<String, List<Map<String, String>>> activityCalendar(String userId, Date date);

    /**
     * 获取个人动态
     */
    List<Map<String, String>> getUserEvent(String userId, Integer offset, Integer limit);
}
